<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="f" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="<%=request.getContextPath() %>/static/common/plugin/bootstrap-3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" href="<%=request.getContextPath() %>/static/common/plugin/toaster/css/toastr.css">
<title>用户信息</title>
</head>
<body>
	<div style="background: #BEEBEB ;width: 100%; font-family: '微软雅黑';">
		<div style="text-align:center;font-size:50px;" >用户信息</div>
		
		
		<div class="bs-example" data-example-id="simple-table">
			<div style="float: left;" >
			<form id="sysUserQuery" action="<%=request.getContextPath() %>/SysUserServlet?command=list" method="post">
			<ul class="list-group">
			  <li class="list-group-item list-group-item-info"><a href="<%=request.getContextPath() %>/view/sysuser/sysuser-add.jsp"><span style="font-size:20px;">.用户新增</span></a></li>
			  <li class="list-group-item list-group-item-success">.账号:<input type="text" name="code" value="${sysUserQuery.code }"></li>
			  <li class="list-group-item list-group-item-info">.姓名:<input type="text" name="username" value="${sysUserQuery.username}"></li>
			  <li class="list-group-item list-group-item-warning">
  				.日期:<input id="d12" type="text" name="dateTime" value="${sysUserQuery.createTimes}"/>
				<img onclick="WdatePicker({el:'d12'})" src="<%=request.getContextPath() %>/static/common/My97DatePicker/skin/datePicker.gif" width="16" height="22" ></li>
  			  <li class="list-group-item list-group-item-danger"><button>查询</button></li>
			</ul>
			</form>
			</div>
	    <div>
	    <table class="table" style="width:80%;float: right;">
	      <thead>
	        <tr>
	          <th>序号</th>
	          <th>帐号</th>
	          <th>姓名</th>
	          <th>性别</th>
	          <th>所属角色</th>
	          <th>创建时间</th>
	          <th>用户状态</th>
	          <th>操作</th>
	        </tr>
	      </thead>
	      <tbody>
	      <c:forEach items="${sysUserEntity.list }" var="sysUser" varStatus="v">
	        <tr>
	          <th scope="row">${v.count+(sysUserEntity.pageNo-1)*10 }</th>
	          <td>${sysUser.code }</td>
	          <td>${sysUser.username }</td>
	          <td>
	          <c:if test="${sysUser.sex==1 }">
	          	${sysUser.userSex }
	          </c:if>
	          <c:if test="${sysUser.sex==2 }">
	          	${sysUser.userSex }
	          </c:if>
	          </td>
	          <td>${sysUser.name }</td>
			  <td><f:formatDate value="${sysUser.createTime }" pattern="yyyy-MM-dd"/></td>
			  <td>
			   <c:if test="${sysUser.state==1 }">
	          	${sysUser.userState }
	          </c:if>
	          <c:if test="${sysUser.state==2 }">
	          	${sysUser.userState }
	          </c:if>
			  </td>
			  <td>
			  <a href="<%=request.getContextPath() %>/SysUserServlet?command=preUpdate&id=${sysUser.id}">修改</a>&nbsp;
			  <c:if test="${sysUser.state==1 }">
	          	<a href="<%=request.getContextPath() %>/SysUserServlet?command=transformation&id=${sysUser.id}&state=${sysUser.state}">禁用</a>&nbsp;
	          </c:if>
	          <c:if test="${sysUser.state==2 }">
	          	<a href="<%=request.getContextPath() %>/SysUserServlet?command=transformation&id=${sysUser.id}&state=${sysUser.state}">启用</a>&nbsp;
	          </c:if>
			  <a href="<%=request.getContextPath() %>/SysUserServlet?command=delete&id=${sysUser.id}">删除</a>
			  </td>
	        </tr>
	        </c:forEach>
	      </tbody>
	     
	        <tr >
	          <td colspan="7" align="right">
	          <nav>
				  <ul class="pagination">
				    <li>
				      <a href="<%=request.getContextPath() %>/SysUserServlet?command=list&pageNo=${sysUserEntity.pre}" aria-label="Previous">
				        <span aria-hidden="true">&laquo;</span>
				      </a>
				    </li>
				    <li><a href="javascript:submitFrom('<%=request.getContextPath() %>/SysUserServlet?command=list&pageNo=${sysUserEntity.first}')">首页</a></li>
				    <li><a href="javascript:submitFrom('<%=request.getContextPath() %>/SysUserServlet?command=list&pageNo=1')">1</a></li>
				    <li><a href="javascript:submitFrom('<%=request.getContextPath() %>/SysUserServlet?command=list&pageNo=2')">2</a></li>
				    <li><a href="javascript:submitFrom('<%=request.getContextPath() %>/SysUserServlet?command=list&pageNo=3')">3</a></li>
				    <li><a href="javascript:submitFrom('<%=request.getContextPath() %>/SysUserServlet?command=list&pageNo=4')">4</a></li>
				    <li><a href="javascript:submitFrom('<%=request.getContextPath() %>/SysUserServlet?command=list&pageNo=5')">5</a></li>
				    <li><a href="#">当前第<span style="color:red;">${sysUserEntity.pageNo }</span>页，共有<span style="color:red;">${sysUserEntity.allRecord}</span>条记录</a></li>
				    <li><a href="javascript:submitFrom('<%=request.getContextPath() %>/SysUserServlet?command=list&pageNo=${sysUserEntity.finish}')">尾页</a></li>
				    <li>
				      <a href="javascript:submitFrom('<%=request.getContextPath() %>/SysUserServlet?command=list&pageNo=${sysUserEntity.next}')" aria-label="Next">
				        <span aria-hidden="true">&raquo;</span>
				      </a>
				    </li>
				  </ul>
				</nav>
	          </td>
	        </tr>
	 
	    </table></div>
	  </div>
  </div>
  <script>
  
  	function submitFrom(url){
  		var sysUserQuery=document.getElementById('sysUserQuery');
  		sysUserQuery.action=url;
  		sysUserQuery.submit();
  	}
  
  
  </script>
    <script  src="<%=request.getContextPath() %>/static/common/My97DatePicker/WdatePicker.js"></script>
	<script src="<%=request.getContextPath() %>/static/common/jquery.min.js"></script>
	<script src="<%=request.getContextPath() %>/static/common/plugin/bootstrap-3.3.5/js/bootstrap.min.js"></script>
</body>
</html>